<?
	$this->load->view('trTemplate');
?>
<div class="control-group">
	<select name="tDiscipline" id="discId" placeholder="строка">
		<option value="">Специальность</option>
		<?foreach($disciplines as $disc):?>
			<option value="<?=$disc->id?>"><?=$disc->pAbrev?></option>
		<?endforeach?>
	</select>

	<select name="tCity" id="cityId" placeholder="строка">
		<option value="">Город</option>
		<?foreach($cities as $city):?>
			<option value="<?=$city->id?>"><?=$city->pTitle?></option>
		<?endforeach?>
	</select>

	
</div>
<table class="table table-hover table-bordered table-striped">
	<thead>
		<tr>
			<th>id</th>
			<th>Фамилия</th>
			<th>Имя</th>
			<th>Спец.</th>
			<th>Город</th>
			<th>Адресс</th>
			<th>Телефон</th>
			<th>Действие</th>
		</tr>
	</thead>
	<tbody id="abiturientsCont">
		<?foreach($abiturients as $abi):?>
			<tr>
				<td><?=$abi->id?></td>
				<td><?=$abi->pFamily?></td>
				<td><?=$abi->pName?></td>
				<td><?=$abi->discipline?></td>
				<td><?=$abi->City?></td>
				<td><?=$abi->pAdress?></td>
				<td><?=$abi->pPhone?></td>
				<td style="width:30px;">
					<div class="btn-group">
						<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
							Action
							<span class="caret"></span>
						</a>
						<ul class="dropdown-menu">
							<li><a href="<?=base_url()?>abiturient/accept/<?=$abi->id?>">Подтвердить</a></li>
							<li><a class="editAbiturient" data-id=<?=$abi->id?>>Редактировать</a></li>
							<li><a href="<?=base_url()?>abiturient/delete/<?=$abi->id?>">Удалить</a></li>
						</ul>
					</div>
				</td>		
			</tr>
		<?endforeach?>
	</tbody>
</table>

<div id="editAbiturientModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h3 id="myModalLabel">Редактирование абитуриента</h3>
	</div>
	<div class="modal-body">
			<div class="form-horizontal">
				<div class="group">
				    <input type="hidden" id="id" value="">
					<label for="NameModal" class="control-label">Фамилия</label>
					<div class="controls">
				    	<input type="text" id="famModal" name="pFamily" class="input-large" placeholder="Фамилия.." value="">
				   </div>
				</div>
				<div class="group">
					<label for="nameModal" class="control-label">Имя</label>
					<div class="controls">
				    	<input type="text" id="nameModal" name="pName" class="input-large" placeholder="Имя.."
				    					value="">
				   </div>
			   </div>
			   <div class="group">
					<label for="discIdModal" class="control-label">Специальность</label>
					<div class="controls">
				    		<select name="tDiscipline" id="discIdModal" placeholder="строка">
								<option value="">Специальность</option>
								<?foreach($disciplines as $disc):?>
									<option value="<?=$disc->id?>"><?=$disc->pAbrev?></option>
								<?endforeach?>
							</select>    	
				   </div>
			   </div>
			   <div class="group">
					<label for="cityIdModal" class="control-label">Город</label>
					<div class="controls">
						<select name="tCity" id="cityIdModal">
							<option value="">Город</option>
							<?foreach($cities as $city):?>
								<option value="<?=$city->id?>"><?=$city->pTitle?></option>
							<?endforeach?>
						</select>		    	
				   </div>
			   </div>
			  	<div class="group">
					<label for="adressModal" class="control-label">Адрес</label>
					<div class="controls">
				    	<input type="text" id="adressModal" name="pName" class="input-large" placeholder="Имя.."
				    					value="">
				   </div>
			   </div>
			  	<div class="group">
					<label for="adressModal" class="control-label">Телефон</label>
					<div class="controls">
				    	<input type="text" id="phoneModal" name="pName" class="input-large" placeholder="Номер телефона.."
				    					value="">
				   </div>
			   </div>
			</div>
	</div>

	<div class="modal-footer">
		<button class="btn btn btn-danger pull-left" class="deleteAbiturient">Удалить</button>
		<button class="btn" data-dismiss="modal" aria-hidden="true">Закрыть</button>
		<button class="btn btn-primary saveAbiturient">Сохранить изменения</button>
	</div>
</div>
